package com.t3go.t3_map_example;

import android.app.Application;
import android.text.TextUtils;

import com.alibaba.android.arouter.launcher.ARouter;
import com.shareware.common.ApplicationKt;
import com.t3go.passenger.base.common.CommonUtils;
import com.t3go.passenger.t3asset.FlutterAssertCallBack;
import com.t3go.passenger.t3asset.manager.T3AssetManager;
import com.t3map.api.T3MapPrivacyManager;
import com.t3map.api.T3MapsInitializer;

import io.flutter.FlutterInjector;

public class StubApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        ApplicationKt.install(this);
        ARouter.init(this);

        T3AssetManager.mCallBack = new FlutterAssertCallBack() {
            @Override
            public String getLookupKeyForAssetInFlutter(String src) {
                return FlutterInjector.instance().flutterLoader().getLookupKeyForAsset(src, "t3_assets");
            }

            @Override
            public void doReport(String name) {
            }
        };

//        if (AppExtKt.appPrivacyHasGrant()) {
        T3MapPrivacyManager.initPrivacy(true);
        String uuidId = CommonUtils.getUuid();
        T3MapsInitializer.init(T3MapsInitializer.MAP_TYPE_AMAP, "p8O5bHSHt5OEiMyvrsEfhOkHNB0r36ia", TextUtils.isEmpty(uuidId) ? "28819221-8115-4788-b3f3-8c042e33686f" : uuidId);
        T3MapsInitializer.setIsDebug(false);//用于开发调试用，腾讯定位打开模拟定位开关，连续定位定位结果不回调了
//        }
    }
}
